﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Ord9a00
    {
		private string _sellid;
		private string _shopid;
		private string _proid;
		private double _price;
		private double _qty;
		private double _amt;
		private string _seller;
        private DateTime? _sellertime;
        private int? _listid;
        private DateTime? _createdate;
		private string _remark;
		private string _muser;
		private string _tmp1;
		private string _tmp2;
        private DateTime? _tmp3;
        private DateTime? _tmp4;
		
        /// <summary>
        /// 销售商主键
        /// </summary>
		public string Sellid
		{
			get { return _sellid;	 }
			set { _sellid=value;	}
		}
        /// <summary>
        /// 门店
        /// </summary>
		public string Shopid
		{
			get { return _shopid;	 }
			set { _shopid=value;	}
		}
        /// <summary>
        /// 商品
        /// </summary>
		public string Proid
		{
			get { return _proid;	 }
			set { _proid=value;	}
		}
        /// <summary>
        /// 销售价
        /// </summary>
		public double Price
		{
			get { return _price;	 }
			set { _price=value;	}
		}
        /// <summary>
        /// 销售量
        /// </summary>
		public double Qty
		{
			get { return _qty;	 }
			set { _qty=value;	}
		}
        /// <summary>
        /// 金额
        /// </summary>
		public double Amt
		{
			get { return _amt;	 }
			set { _amt=value;	}
		}
        /// <summary>
        /// 销售人
        /// </summary>
		public string Seller
		{
			get { return _seller;	 }
			set { _seller=value;	}
		}
        /// <summary>
        /// 销售时间
        /// </summary>
		public DateTime? Sellertime
		{
			get { return _sellertime;	 }
			set { _sellertime=value;	}
		}
        /// <summary>
        /// 主键
        /// </summary>
		public int? Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 创建时间
        /// </summary>
		public DateTime? Createdate
		{
			get { return _createdate;	 }
			set { _createdate=value;	}
		}
        /// <summary>
        /// 备注
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 备用字段1
        /// </summary>
		public string Tmp1
		{
			get { return _tmp1;	 }
			set { _tmp1=value;	}
		}
        /// <summary>
        /// 备用字段2
        /// </summary>
		public string Tmp2
		{
			get { return _tmp2;	 }
			set { _tmp2=value;	}
		}
        /// <summary>
        /// 备用字段3
        /// </summary>
		public DateTime? Tmp3
		{
			get { return _tmp3;	 }
			set { _tmp3=value;	}
		}
        /// <summary>
        /// 备用字段4
        /// </summary>
		public DateTime? Tmp4
		{
			get { return _tmp4;	 }
			set { _tmp4=value;	}
		}
		
		public static List<Ord9a00> GetOrd9a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Ord9a00> list = new List<Ord9a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Ord9a00 model = GetOrd9a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Ord9a00 GetOrd9a00ByDataRow(DataRow dr)
		{
			Ord9a00 model = new Ord9a00(); //实例化Ord9a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("sellid")&&!(dr["sellid"] is System.DBNull))  
				model.Sellid = ( string)dr["sellid"];
			if (dcc.Contains("shopid")&&!(dr["shopid"] is System.DBNull))  
				model.Shopid = ( string)dr["shopid"];
			if (dcc.Contains("proid")&&!(dr["proid"] is System.DBNull))  
				model.Proid = ( string)dr["proid"];
			if (dcc.Contains("price")&&!(dr["price"] is System.DBNull))  
				model.Price = Convert.ToDouble(dr["price"]);
			if (dcc.Contains("qty")&&!(dr["qty"] is System.DBNull))  
				model.Qty = Convert.ToDouble(dr["qty"]);
			if (dcc.Contains("amt")&&!(dr["amt"] is System.DBNull))  
				model.Amt = Convert.ToDouble(dr["amt"]);
			if (dcc.Contains("seller")&&!(dr["seller"] is System.DBNull))  
				model.Seller = ( string)dr["seller"];
			if (dcc.Contains("sellertime")&&!(dr["sellertime"] is System.DBNull))  
				model.Sellertime = ( DateTime)dr["sellertime"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( int)dr["listid"];
			if (dcc.Contains("createdate")&&!(dr["createdate"] is System.DBNull))  
				model.Createdate = ( DateTime)dr["createdate"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("tmp1")&&!(dr["tmp1"] is System.DBNull))  
				model.Tmp1 = ( string)dr["tmp1"];
			if (dcc.Contains("tmp2")&&!(dr["tmp2"] is System.DBNull))  
				model.Tmp2 = ( string)dr["tmp2"];
			if (dcc.Contains("tmp3")&&!(dr["tmp3"] is System.DBNull))  
				model.Tmp3 = ( DateTime)dr["tmp3"];
			if (dcc.Contains("tmp4")&&!(dr["tmp4"] is System.DBNull))  
				model.Tmp4 = ( DateTime)dr["tmp4"];
			
			return model;
		}
    }
}
